package com.ssps.front.rent.service.impl;

import com.ssps.entity.User;
import com.ssps.front.rent.service.LessorUserService;
import com.ssps.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lg
 * @time 2020/07/22 15:54:42
 */
@Service
public class LessorUserServiceImpl implements LessorUserService {

  @Autowired
    UserMapper userMapper;


    @Override
    public void add(User user) {

    }

    @Override
    public void delete(Integer[] cid) {

    }

    @Override
    public User findByUids(Integer uid) {
      User user = userMapper.selectByPrimaryKey (uid);

       return  user;

    }

    @Override
    public List<User> findByUid(Integer uid) {
        return null;
    }

  @Override
  public List<User> findAll() {

    List<User> list = userMapper.selectByExample (null);
    System.out.println (list);
    return  list;
    }

  // 查询该出租户的所有车位信息以及所在小区的名称
  @Override
  public List<User> findAlls(int i) {

        List<User> list1 = userMapper.selectByUid (i);

        return list1;
  }

  @Override
  public void updates(User user1) {

      userMapper.updateByPrimaryKey (user1);
  }

  @Override
  public void updateUser(User loginUser) {
           userMapper.updateByPrimaryKey (loginUser);
  }


}
